package com.sengled.cloud.biz.union.mgt.dao.sys;


import com.sengled.cloud.biz.union.mgt.model.po.ModulePermission;
import com.sengled.cloud.biz.union.mgt.model.po.Permission;
import com.sengled.cloud.biz.union.mgt.model.vo.PermissionWithChecked;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface ModulePermissionDao {
    int deleteByPrimaryKey(Long id);

    int insert(ModulePermission record);

    int insertSelective(ModulePermission record);

    ModulePermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ModulePermission record);

    int updateByPrimaryKey(ModulePermission record);

    @Select("select p.id as id,p.permission_code as permissionCode,p.permission_name as permissionName from module_permission mp INNER JOIN permission p on p.id = mp.permission_id where mp.seal_mark = 0 and mp.module_id = #{moduleId}")
    List<PermissionWithChecked> selectByModuleKey(Long moduleId);
}